package com.mp.approvalreq.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.mp.user.entity.User;
import com.plusmoney.util.Utils;

import java.util.Date;

public class ApprovalModify {

    @JSONField(deserialize = false,serialize = false)
    private Integer id;

    @JSONField(deserialize = false,serialize = false)
    private Integer companyId;

    private Integer companyInfoId;

    private String title;

    private String detail;

    @JSONField(deserialize = false,serialize = false)
    private Integer templateId;

    @JSONField(deserialize = false,serialize = false)
    private Integer templateAncestorId;

    private Date modifyTime;

    public ApprovalModify() {
    }

    public ApprovalModify(Template template) {
        User user = template.getUser();
        this.companyId = user.getCompanyId();
        this.companyInfoId = user.getCompanyInfoId();
        this.templateId = template.getTemplateId();
        this.templateAncestorId = Utils.isNull(template.getAncestorId()) ? 0 : template.getAncestorId();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public Integer getCompanyInfoId() {
        return companyInfoId;
    }

    public void setCompanyInfoId(Integer companyInfoId) {
        this.companyInfoId = companyInfoId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Integer getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }

    public Integer getTemplateAncestorId() {
        return templateAncestorId;
    }

    public void setTemplateAncestorId(Integer templateAncestorId) {
        this.templateAncestorId = templateAncestorId;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
}
